package com.hzlj.position.locate.common.enums;

import com.fz.common.base.exception.PubError;
import com.fz.common.base.exception.PubException;
import lombok.Getter;

/**
 * @author lifh
 * @date 2021/11/9 上午11:59
 **/
@Getter
public enum ReportAudioStatus {
    /**
     * 正常
     */
    NORMAL("1", "正常"),
    /**
     * 异常
     */
    ABN("2", "异常"),
    ;

    private final String status;
    private final String statusText;

    ReportAudioStatus(String status, String statusText) {
        this.status = status;
        this.statusText = statusText;
    }

    public static ReportAudioStatus of(String status) {
        for (ReportAudioStatus reportStatus : values()) {
            if (reportStatus.getStatus().equals(status)) {
                return reportStatus;
            }
        }
        throw new PubException(PubError.PARAM_EMPTY_ERROR);
    }
}
